﻿using System;
using System.ComponentModel.Composition.Primitives;
using System.Windows;
using System.Windows.Controls;

using DSLPedItemWizard.ViewModels;

using Dsl.Ped.Framework.AddIns;
using GalaSoft.MvvmLight.Messaging;

namespace DSLPedItemWizard.Views
{
    /// <summary>
    /// Interaction logic for SelectionWizardView.xaml
    /// </summary>
    public partial class SelectionWizardView : IWizardPage
    {
        private SelectionWizardViewModel viewModel;

        public SelectionWizardView(ComposablePartCatalog catalog, Messenger messenger)
        {
            InitializeComponent();
            viewModel = new SelectionWizardViewModel(catalog, messenger);
            this.DataContext = viewModel;
        }

        public Lazy<IDslPedAddIn, IDslPedAddInMetadata> SelectedAddIn
        {
            get
            {
                return viewModel.SelectedAddIn;
            }
        }

        public bool CanFinish
        {
            get
            {
                return viewModel.SelectedAddIn != null;
            }
        }

        public FrameworkElement View
        {
            get
            {
                return this;
            }
        }
    }
}
